FROM alpine:3.11.13
RUN sed -i "s@dl-cdn.alpinelinux.org@mirrors.aliyun.com@g" /etc/apk/repositories \
&& apk --update add --no-cache openrc mysql \
&& sed -i 's/skip-networking/#skip-networking/g' /etc/my.cnf.d/mariadb-server.cnf \
&& sed -i 's/#bind-address/bind-address/g' /etc/my.cnf.d/mariadb-server.cnf \
&& rc-update add mariadb boot \
&& echo -e '#! /bin/sh\nrc default\nwhile true\ndo\n\tsleep 60\ndone' > /usr/local/bin/start.sh \
&& chmod +x /usr/local/bin/start.sh
EXPOSE 3306
